﻿using MengLin.OOP.DesignPattern.WMS_LC4.Implements.HardwarePlatform;
using MengLin.OOP.DesignPattern.WMS_LC4.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.WMS_LC4.Implements.AlarmListener
{
    /// <summary>
    /// 实现IAlarmListener接口的匿名适配类
    /// 像不像适配器模式
    /// </summary>
    public class AnonymousAlarmListener : IAlarmListener
    {
        private AbstractTemperatureSensor _iTemperatureSensor;
        public AnonymousAlarmListener(AbstractTemperatureSensor iTemperatureSensor)
        {
            _iTemperatureSensor = iTemperatureSensor;
        }

        /// <summary>
        /// 醒来
        /// </summary>
        public void Wakeup()
        {
            _iTemperatureSensor.Check();
        }
    }
}
